<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/commons/taglibs.jsp" %>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>角色管理</title>

<%@ include file="/commons/css_js_head.jsp" %>

<script type="text/javascript">
//复写Url
doListUrl = "${ctx }/permission/efRoleAction!doList.ts";
doAddBeforeUrl = "${ctx }/permission/efRoleAction!doFindById.ts";
doUpdateBeforeUrl = "${ctx }/permission/efRoleAction!doFindById.ts";
doDelUrl="${ctx }/permission/efRoleAction!doDelete.ts";
		
//添加之前
function doAddBefore(){
   var _form = document.forms[0];
   if(doAddBeforeUrl == ''){
   	alert('请设置正确的URL!');
   	return false;
   }

   _form.action = doAddBeforeUrl;
   _form.submit();
}

//更新之前 
function doUpdateBefore(pkId){
   var _form = document.forms[0];
   if(doUpdateBeforeUrl == ''){
   	alert('请设置正确的URL!');
   	return false;
   }

   _form.action = doUpdateBeforeUrl+"?roleId="+pkId;
   _form.submit();
}

//删除
function doDel(pkId){
   var _form = document.forms[0];
   if(doDelUrl == ''){
   	alert('请设置正确的URL!');
   	return false;
   }
   
   if(confirm("你确定删除当前角色吗？\n删除该角色时，与该角色对应的权限也将随之删除")){
   		_form.action = doDelUrl+"?roleId="+pkId;
  		_form.submit();
   }
}

</script>

</head>
<body style="overflow-x:hidden">

<!-- 标题 -->
<div class="mTitle">
  <span class="hidsearch"><a href="javascript:void(0)" onclick="return chg('searchList');" id="ImgArrow">
  	<img src="${ctx}/images/icon_up.gif" id ="imgButton" /></a>
  </span>
  <b class="bbig">角色管理</b>
  <a href="javascript:void(0)" onclick="javascript:doAddBefore();">增加角色</a>
</div>

<!-- 查询条件 -->
<div class="searchBar" id="searchList" style="display:block;">
<s:form action="/permission/efRoleAction!doList.ts" id="form1" method="post">
  <table class="searchTable">
	  <tr>
		<th>角色名称：</th>
	    <td>
	    	<s:textfield name="roleName" theme="simple"></s:textfield>
	    </td>
	    <th>角色编码：</th>
	    <td>
	    	<s:textfield name="roleCode" theme="simple"></s:textfield>
	    </td>
	    <td>
	    	<input name="btn_query" type="button" class="btn" value="查询" onclick="doQuery()" />
	    	<input name="btn_reset" type="button" class="btn" value="清空查询条件" onclick="doReset()" />
	    </td>
	  </tr>
  </table>
</s:form>
</div>

<!-- start 显示内容 -->
<aa:zone name="zoneList">
<div class="mainList">

<table class="listTable">
  <tr>
   
		<th  width="15%" class="find_td01 fs14 fb">角色名称</th>
		<th  width="15%" class="find_td01 fs14 fb">角色编码</th>
		<th  width="15%" class="find_td01 fs14 fb">角色状态</th>
		<th  width="15%" class="find_td01 fs14 fb">角色所属用户数</th>
		<th  width="15%" class="find_td01 fs14 fb">角色所属菜单数</th>
		<th >操作</th>
		
  </tr>
<c:forEach var="role" items="${voList}">
	<tr align=center>
		<td >${role.roleName}</td>
		<td >${role.roleCode}</td>
		<td >
			<c:if test="${role.dicRoleIsValid==1}"><span class="icon_yes">&nbsp;</span></c:if>
           	<c:if test="${role.dicRoleIsValid==0}"><span class="icon_no">&nbsp;</span></c:if>
			<ef:CodeToName groupname="DicRoleIsValid" translateValue="${role.dicRoleIsValid}"></ef:CodeToName>
		</td>
		<td >
		</td>
		<td ></td>
		<td >
			<a href="javascript:void(0)" onclick="javascript:doUpdateBefore('${role.roleId}')"><span class="icon_edit">&nbsp;</span>修改</a>
			<a href="javascript:void(0)" onclick="javascript:doDel('${role.roleId}');"><span class="icon_del">&nbsp;</span>删除</a>
			<a href="${ctx }/permission/efRoleAction!doGiveLimitsBefore.ts?roleId=${role.roleId}&keepThis=true&TB_iframe=true&height=430&width=482&modal=true" class="thickbox"><span class="icon_list">&nbsp;</span>授权</a>
		</td>
	
	</tr>
</c:forEach>

</table>
</div>
</aa:zone>
<!-- end 显示内容 -->

<!-- 分页区域  -->
<div class="Toolbar">
	<div class="listTool">
		<div class="page">
		
		</div>
	</div>
</div>

<script type="text/javascript">
ajaxAnywhere.formName = "form1";
ajaxAnywhere.getZonesToReload = function() {
    return "zoneList";
}
</script>


</body>
</html>
